<template>
  <el-scrollbar>
    <el-menu :show-timeout="200" :default-active="$route.path" :collapse="isCollapse"
      :background-color="variables.menuBg" :text-color="variables.menuText"
      :active-text-color="variables.menuActiveText" :unique-opened="true" mode="vertical">
      <sidebar-item v-for="route in permission_routers" :key="route.path" :item="route" :base-path="route.path" />
    </el-menu>
  </el-scrollbar>
</template>

<script>
import SidebarItem from './SidebarItem.vue'
import { mapGetters } from 'vuex'
import variables from '@/styles/variables.scss'

export default {
  components: {
    SidebarItem
  },
  computed: {
    ...mapGetters(['menuList', 'permission_routers', 'sidebar']),
    variables() {
      return variables
    },
    isCollapse() {
      return !this.sidebar.opened
    }
  }

}
</script>
<style scoped >
.el-menu {
  border-right: 0;
  /* width: 280px !important; */
  height: calc(100vh - 60px);
}
.el-menu :hover {
  color: #409eff;
}
</style>

